<?php
session_start();
$name = $_SESSION["adminname"];
date_default_timezone_set('Asia/Shanghai');//设置为北京时间
$returnDate=date("Y-m-d");//自动获取时间(年月日)
$mysqli = mysqli_connect("localhost", "root", "123456", "library");
mysqli_query($mysqli,"SET NAMES 'utf8'");
$reader = 'select count(*) from reader';
$book = 'select count(*) from book where inLibStatus=\'available\'';
$borrow = 'select count(*) from borrowbook';
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="description" content="12">
    <meta name="author" content="12">
    <meta name="keyword" content="12">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>首页 </title>
    <!-- start: Css -->
    <link rel="stylesheet" type="text/css" href="asset/css/bootstrap.min.css">
    <!-- plugins -->
    <link rel="stylesheet" type="text/css" href="asset/css/plugins/font-awesome.min.css"/>
    <link rel="stylesheet" type="text/css" href="asset/css/plugins/simple-line-icons.css"/>
    <link rel="stylesheet" type="text/css" href="asset/css/plugins/animate.min.css"/>
    <link rel="stylesheet" type="text/css" href="asset/css/plugins/fullcalendar.min.css"/>
    <link href="asset/css/style.css" rel="stylesheet">
    <!-- end: Css -->
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="asset/js/html5shiv.min.js"></script>
    <script src="asset/js/respond.min.js"></script>
    <![endif]-->
</head>

<body id="mimin" class="dashboard">
<!-- start: Header -->
<nav class="navbar navbar-default header navbar-fixed-top">
    <div class="col-md-12 nav-wrapper">
        <div class="navbar-header" style="width:100%;">
            <div class="opener-left-menu is-open"> <span class="top"></span> <span class="middle"></span> <span class="bottom"></span> </div>
            <a href="index_normal.php" class="navbar-brand"> <b>图书管理系统</b> </a>
            <ul class="nav navbar-nav navbar-right user-nav">
                <li class="user-name"><span><?php echo $name?></span></li>
                <li class="dropdown avatar-dropdown"> <img src="asset/img/avatar.jpg" class="img-circle avatar" alt="user name" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"/>
                    <ul class="dropdown-menu user-dropdown">
                        <li><a href="index.html"><span class="fa fa-power-off"></span> 退出登录</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
</nav>
<!-- end: Header -->
<div class="container-fluid mimin-wrapper">
    <!-- start:Left Menu -->
    <div id="left-menu">
        <div class="sub-left-menu scroll">
            <ul class="nav nav-list">
                <li>
                    <div class="left-bg"></div>
                </li>
                <li class="active ripple"> <a class="tree-toggle nav-header"><span class="fa-home fa"></span> 首页 <span class="fa-angle-right fa right-arrow text-right"></span> </a> </li>
                <li class="ripple"> <a class="tree-toggle nav-header"> <span class="fa-diamond fa"></span> 图书管理 <span class="fa-angle-right fa right-arrow text-right"></span> </a>
                    <ul class="nav nav-list tree">
                        <li><a href="bookstate_normal.php">图书在馆状态</a></li>
                        <li><a href="bookbo_normal.php">图书借阅记录</a></li>
                        <li><a href="bookinser_normal.php">上架新书</a></li>
                        <li><a href="bookdelete_normal.php">下架图书</a></li>
                        <li><a href="bookda_normal.php">图书损失记录</a></li>
                        <li><a href="fine_normal.php">记录罚款信息</a></li>
                    </ul>
                </li>
                <li class=" ripple"> <a class="tree-toggle nav-header"  id="left-menu-3"><span class="fa fa-check-square-o"></span> 用户管理 <span class="fa-angle-right fa right-arrow text-right"></span> </a>
                    <ul class="nav nav-list tree" >
                        <li><a href="readerbor_normal.php">用户借阅记录</a></li>
                        <li><a href="readerfine_normal.php">罚款记录</a></li>
                        <li><a href="readerselect_normal.php">查询用户</a></li>
                        <li><a href="readerinsert_normal.php">新增用户</a></li>
                        <li><a href="readerdelete_normal.php">删除用户</a></li>
                    </ul>
                </li>
                <li class=" ripple"> <a class="tree-toggle nav-header"  id="left-menu-3"><span class="fa fa-check-square-o"></span> 我的 <span class="fa-angle-right fa right-arrow text-right"></span> </a>
                    <ul class="nav nav-list tree" >
                        <li><a href="pwd_normal.php">修改密码</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <!-- end: Left Menu -->

    <!-- start: content -->
    <div id="content">
        <div class="panel">
            <div class="panel-body">
                <div class="col-md-6 col-sm-12">
                    <h3 class="animated fadeInLeft">欢迎您：亲爱的管理员！</h3>
                    <p class="animated fadeInDown"><span class="fa  fa-map-marker"></span>管理员</p>
                </div>
            </div>
        </div>
        <div class="col-md-12" style="padding:20px;">
            <div class="col-md-12 padding-0">
                <div class="col-md-8 padding-0">
                    <div class="col-md-12 padding-0">
                        <div class="col-md-6">
                            <div class="panel box-v1">
                                <div class="panel-heading bg-white border-none">
                                    <div class="col-md-6 col-sm-6 col-xs-6 text-left padding-0">
                                        <h4 class="text-left">今日热点</h4>
                                    </div>
                                    <div class="col-md-6 col-sm-6 col-xs-6 text-right">
                                        <h4> <span class="icon-user icons icon text-right"></span> </h4>
                                    </div>
                                </div>
                                <div class="panel-body text-center">
                                    <ul class="normal-list">
                                        <li class="text-left"><span class="right"><?php echo $returnDate?></span><a href="https://news.ifeng.com/c/81u3UVn3yIA"><span class="fa fa-angle-right"></span> 脱贫摘帽之后怎么干？习近平这样部署</a></li>
                                        <li class="text-left"><span class="right"><?php echo $returnDate?></span><a href="https://news.ifeng.com/c/81u4Wk1c9Iw"><span class="fa fa-angle-right"></span> 美众院通过法案威胁禁止中国公司在美上市？外交部回应</a></li>
                                        <li class="text-left"><span class="right"><?php echo $returnDate?></span><a href="https://news.ifeng.com/c/81uCHi1BzPj"><span class="fa fa-angle-right"></span> 美媒：特朗普政府限制中共党员及亲属赴美旅行</a></li>
                                        <li class="text-left"><span class="right"><?php echo $returnDate?></span><a href="https://news.ifeng.com/c/81uCHi1BzMN"><span class="fa fa-angle-right"></span> 浙江玉环发现一份进口冷冻猪肉标本核酸检测呈阳性</a></li>
                                        <li class="text-left"><span class="right"><?php echo $returnDate?></span><a href="https://news.ifeng.com/c/81uCCkpWSoi"><span class="fa fa-angle-right"></span> 土耳其宣布本月开始接种中国新冠疫苗 将分四阶段进行</a></li>
                                        <li class="text-left"><span class="right"><?php echo $returnDate?></span><a href="https://news.ifeng.com/c/81uALPXmZJe"><span class="fa fa-angle-right"></span> 新华社对话多位体育专家：体育高考应该实行，宜早做筹备</a></li>
                                        <li class="text-left"><span class="right"><?php echo $returnDate?></span><a href="https://news.ifeng.com/c/81u6YgWhgdg"><span class="fa fa-angle-right"></span> 女子看守所中毒身亡：家属22年后得知死因，相关人员事发后被调离</a></li>
                                        <li class="text-left"><span class="right"><?php echo $returnDate?></span><a href="https://news.ifeng.com/c/81u4V3P0igt"><span class="fa fa-angle-right"></span> 内容有掩藏 追责有难度——澳军战争罪行调查报告的背后</a></li>
                                    </ul>
                                    <p><a href="https://news.ifeng.com/">更多信息</a></p>
                                    <hr/>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="panel box-v1">
                                <div class="panel-heading bg-white border-none">
                                    <div class="col-md-6 col-sm-6 col-xs-6 text-left padding-0">
                                        <h4 class="text-left">热书推荐</h4>
                                    </div>
                                    <div class="col-md-6 col-sm-6 col-xs-6 text-right">
                                        <h4> <span class="icon-check icons icon text-right"></span> </h4>
                                    </div>
                                </div>
                                <div class="panel-body text-center">
                                    <ul class="normal-list">
                                        <li class="text-left"><span class="right"><?php echo $returnDate?></span><a href="http://product.dangdang.com/1581690217.html"><span class="fa fa-angle-right"></span> 洛克菲勒留给儿子的38封信 洛克菲勒写给儿子的38封信 </a></li>
                                        <li class="text-left"><span class="right"><?php echo $returnDate?></span><a href="http://product.dangdang.com/1581204877.html"><span class="fa fa-angle-right"></span> 哈佛凌晨四点半青少年励志的书</a></li>
                                        <li class="text-left"><span class="right"><?php echo $returnDate?></span><a href="http://product.dangdang.com/1581210387.html"><span class="fa fa-angle-right"></span> 稻盛和夫给年轻人的忠告励志畅销书排行榜前十名</a></li>
                                        <li class="text-left"><span class="right"><?php echo $returnDate?></span><a href="http://product.dangdang.com/1581734257.html"><span class="fa fa-angle-right"></span> 巴菲特给儿女的一生忠告 教育孩子的畅销书</a></li>
                                        <li class="text-left"><span class="right"><?php echo $returnDate?></span><a href="http://product.dangdang.com/1581745077.html"><span class="fa fa-angle-right"></span> 自卑与超越阿德勒畅销书排行榜前十名</a></li>
                                        <li class="text-left"><span class="right"><?php echo $returnDate?></span><a href="http://product.dangdang.com/1500787057.html"><span class="fa fa-angle-right"></span> 鬼谷子全集狼道正版墨菲定律人性的弱点</a></li>
                                        <li class="text-left"><span class="right"><?php echo $returnDate?></span><a href="http://product.dangdang.com/1431787023.html"><span class="fa fa-angle-right"></span>8册学会做自己 儿童绘本3 6岁经典绘本 </a></li>
                                        <li class="text-left"><span class="right"><?php echo $returnDate?></span><a href="http://product.dangdang.com/1642087627.html"><span class="fa fa-angle-right"></span> 自控力+拖延心理学+乌合之众</a></li>
                                    </ul>
                                    <p><a href="http://search.dangdang.com/?key=%E7%95%85%E9%94%80%E4%B9%A6%E6%8E%92%E8%A1%8C%E6%A6%9C%E5%89%8D%E5%8D%81%E5%90%8D&act=click">更多信息</a></p>
                                    <hr/>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="col-md-12 padding-0">
                        <div class="panel box-v2">
                            <div class="panel-heading padding-0"> <img src="asset/img/bg2.jpg" class="box-v2-cover img-responsive"/>
                                <div class="box-v2-detail"> <img src="asset/img/avatar.jpg" class="img-responsive"/>
                                    <h4><?php echo $name?></h4>
                                </div>
                            </div>
                            <div class="panel-body">
                                <div class="col-md-12 padding-0 text-center">
                                    <div class="col-md-4 col-sm-4 col-xs-6 padding-0">
                                        <h3>
                                        <?php
                                        $infoQuery = mysqli_query($mysqli,$reader);
                                        $info = mysqli_fetch_row($infoQuery);
                                        echo $info[0]?>
                                        </h3>
                                        <p>图书馆在线人数</p>
                                    </div>
                                    <div class="col-md-4 col-sm-4 col-xs-6 padding-0">
                                        <h3>
                                            <?php
                                            $infoQuery = mysqli_query($mysqli,$book);
                                            $info = mysqli_fetch_row($infoQuery);
                                            echo $info[0]?>
                                        </h3>
                                        <p>书籍在架总数</p>
                                    </div>
                                    <div class="col-md-4 col-sm-4 col-xs-6 padding-0">
                                        <h3>
                                            <?php
                                            $infoQuery = mysqli_query($mysqli,$borrow);
                                            $info = mysqli_fetch_row($infoQuery);
                                            echo $info[0]?>
                                        </h3>
                                        <p>借阅总数</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- end: content -->

</div>

<!-- start: Javascript -->
<script src="asset/js/jquery.min.js"></script>
<script src="asset/js/jquery.ui.min.js"></script>
<script src="asset/js/bootstrap.min.js"></script>
<!-- plugins -->
<script src="asset/js/plugins/jquery.nicescroll.js"></script>
<!-- custom -->
<script src="asset/js/main.js"></script>
<!-- end: Javascript -->
<div style="text-align:center;">
    <p></p>
</div>
</body>
</html>